package com.example.controller;

import com.example.entity.Address;
import com.example.service.AddressService;
import com.example.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "地址管理")
@CrossOrigin
@RequestMapping("/addressController")
@RestController
public class AddressController {

    @Autowired
    private AddressService addressService;

    @ApiOperation(value = "根据add_id查询地址")
    @GetMapping("listAddress/{addId}")
    public R selectAddress(@PathVariable String addId) {
        Address address = addressService.getById(addId);
        return R.ok().data("address", address);
    }
}
